/*
 * @Description: app仓库
 * @Author: LDM
 * @Date: 2021-09-11 11:48:42
 * @LastEditors: LDM
 * @LastEditTime: 2021-09-30 16:32:14
 */
import { defineStore, acceptHMRUpdate } from 'pinia'
import { pinia } from '/@/store'
interface IAppState {
  name?: string
}
export const useAppStore = defineStore('app', {
  state: (): IAppState => ({
    name: ''
  })
})

/**
 * @description: 在setup外使用仓库时调用
 * @return {*} 返回AppStore
 */
export function useAppStoreWithOut() {
  return useAppStore(pinia)
}
// make sure to pass the right store definition, `useAuth` in this case.
if (import.meta.hot) {
  import.meta.hot.accept(acceptHMRUpdate(useAppStore, import.meta.hot))
}
